<?php

namespace App\Console\Commands\Controller;

use App\Console\BaseCommand;
use App\Models\LibraryFile;

class LibraryFileCommand extends BaseCommand
{
    protected $signature = 'controller:library-file {action} {json}';

    protected $description = 'library file commands';

    public function create($loadData)
    {
        $query = LibraryFile::getInstance()
            ->where('file_hash', $loadData['file_hash']);
        if (empty($query->first())) {
            $query->insert($loadData);
        }

        return true;
    }
}
